package com.service.websocket.to;

/**
 * @author xianggj
 * @description: 消息返回对象
 * @date 2019/8/28 10:13
 */
public enum ReturnTarget {
    /**
     * 窗口级
     */
    WIN("window"),
    /**
     * 用户级
     */
    USER("user"),
    /**
     * 根据业务id通知
     */
    BUS("bus"),
    /**
     * 全局通知
     */
    ALL("all"),
    ;

    ReturnTarget(String value) {
        this.value = value;
    }

    private String value;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static ReturnTarget get(String value){
        for (ReturnTarget r : values()) {
            if (r.getValue().equals(value)){
                return r;
            }
        }
        return USER;
    }
}
